<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

/**
 * 亲密度记录
 */
class CloseFriendLog extends Model
{
    protected $table = 'user_close_friend_log';
    protected $fillable = ['user_id', 'frd_user_id', 'flag', 'close_value', 'from'];

    /**
     * 添加记录
     */
    static function addRecord($userId = 0, $frdUserId = 0, $value = 0.0, $from = 1)
    {
        return self::create([
            'user_id' => $userId,
            'frd_user_id' => $frdUserId,
            'close_value' => $value,
            'from' => $from
        ]);
    }
}
